#ifndef _IP_SCAN_H_
#define _IP_SCAN_H_

#include "common/common.h"
#include "json/json-usr.h"
#include "device/dev_common.h"


namespace iecas_ns
{
    class CIpScan
    {
        #define INIT_IP_SCAN "shell/init-ip-scan.sh"
        #define CONNECTED_IP_TXT_FILE_NAME "txt/connected-ip.txt"
        #define DHCP_LEASE_TXT_FILE_NAME "/var/tmp/dnsmasq.leases"

		public:
			static shared_ptr<CIpScan> getInstance();
            CIpScan();
			bool init(void);
            void start(void);
		private:
			static shared_ptr<CIpScan> sm_intancePtr;
            void loop(void);
            void get_ip_not_socket(void);
            void ip_dev_up_down(void);
            void get_ip_dev_name(vector<string> ip_dev_name);
            vector<string> ip_dev_name;
            vector<string> ip_current;
            shared_ptr<CCommon> m_commonPtr;
            shared_ptr<CJsonUsr> m_jsonUsrPtr;
            shared_ptr<CDevCommon> m_devCommonPtr;
            string pwd_shell;
    };
}

#endif